Clip to cell_area when rendering cell content
authorKristian Rietveld <kris@gtk.org>
Wed, 15 Dec 2010 23:07:08 +0000 (00:07 +0100)
committerKristian Rietveld <kris@gtk.org>
Wed, 15 Dec 2010 23:07:08 +0000 (00:07 +0100)
commita28c11a27f410121de949aac92dbeaad73401dbc
tree700ab8749ef84fbb57f23ae6adb944e82db72dd4
parentc8d130efa7a0d807bdaa50381d12c3f4223e8e2c
Clip to cell_area when rendering cell content

This fixes a GTK+ 3.0 regression.  In GTK+ 2, the render method
on GtkCellRenderer had a expose_area parameter, typically set to
cell_area.  This parameter was used for clipping cell content to be
rendered to the cell area (and thus clipping to within the focus
rectangle).  During the rendering clean up this parameter was removed
and no clipping put back into place.

Since expose_area was usually equal to cell_area anyway, it does not make
sense to reintroduce the expose_area parameter.  Instead, we do clipping at
two levels:
 - in gtk_cell_renderer_render() we clip to background_area.  We cannot
clip to cell_area here because we want to allow cell renderers to
render in the background area (e.g. background color/effect).
 - cell renderers should clip to clip_area when rendering cell
content individually (as they had to individually clip to expose_region
before).
gtk/gtkcellrenderer.c
gtk/gtkcellrendererspinner.c
gtk/gtkcellrenderertext.c
gtk/gtkcellrenderertoggle.c